import Vue from 'vue'
import Vuex from 'vuex'

import getlink from "@/api/getlink.js"

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    arr: [],
    arr1: [],
    arr2: [],
    wjnan:[],
    wjnv:[],
    xinshu:[]
  },
  mutations: {
    getnum(state,payload) {
      state.arr = payload.num.data
      state.arr1 = payload.num.datawb
      state.arr2 = payload.num.databk
      state.wjnan=payload.num.datanan
      state.wjnv=payload.num.datanv
      state.xinshu=payload.num.dataxinshu
    }
  },
  // 做异步操作
  actions: {
    getaxios(context,payload){
      console.log(context);
      getlink(payload).then((ok)=>{
        context.commit('getnum',{num: ok.data})
      })
    }
  },
  modules: {
  }
})
